package com.luxoft.scoremanager.server.model.dao;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.io.Serializable;


@Entity
@Table
public class StaticDataDaoModel implements Serializable {
    private static final long serialVersionUID = -5170875020617735665L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "my_entity_seq_gen")
    @SequenceGenerator(name = "my_entity_seq_gen", sequenceName = "SD_SEQ")
    @Column(name = "Static_Data_ID")
    private Integer id;

    @Column
    private String label;

    @Column
    private String staticDataSet;

    public StaticDataDaoModel(String label, String staticDataSet) {
        this.label = label;
        this.staticDataSet = staticDataSet;
    }

    public StaticDataDaoModel(Integer id, String label, String staticDataSet) {
        this.setId(id);
        this.label = label;
        this.staticDataSet = staticDataSet;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        StaticDataDaoModel that = (StaticDataDaoModel) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }

    public Integer getId() {

        return id;
    }

    @Override
    public String toString() {
        return "StaticDataDao{" +
                "id=" + id +
                ", label='" + label + '\'' +
                ", staticDataSet='" + staticDataSet + '\'' +
                '}';
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getStaticDataSet() {
        return staticDataSet;
    }

    public void setStaticDataSet(String staticDataSet) {
        this.staticDataSet = staticDataSet;
    }

    public StaticDataDaoModel() {

    }
}
